package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PartyProbationaryMapper;
import com.ruoyi.system.domain.PartyProbationary;
import com.ruoyi.system.service.IPartyProbationaryService;

/**
 * 预备党员申请Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-16
 */
@Service
public class PartyProbationaryServiceImpl implements IPartyProbationaryService 
{
    @Autowired
    private PartyProbationaryMapper partyProbationaryMapper;

    /**
     * 查询预备党员申请
     * 
     * @param probationaryId 预备党员申请主键
     * @return 预备党员申请
     */
    @Override
    public PartyProbationary selectPartyProbationaryByProbationaryId(Long probationaryId)
    {
        return partyProbationaryMapper.selectPartyProbationaryByProbationaryId(probationaryId);
    }

    /**
     * 查询预备党员申请列表
     * 
     * @param partyProbationary 预备党员申请
     * @return 预备党员申请
     */
    @Override
    public List<PartyProbationary> selectPartyProbationaryList(PartyProbationary partyProbationary)
    {
        return partyProbationaryMapper.selectPartyProbationaryList(partyProbationary);
    }

    /**
     * 新增预备党员申请
     * 
     * @param partyProbationary 预备党员申请
     * @return 结果
     */
    @Override
    public int insertPartyProbationary(PartyProbationary partyProbationary)
    {
        partyProbationary.setCreateTime(DateUtils.getNowDate());
        return partyProbationaryMapper.insertPartyProbationary(partyProbationary);
    }

    /**
     * 修改预备党员申请
     * 
     * @param partyProbationary 预备党员申请
     * @return 结果
     */
    @Override
    public int updatePartyProbationary(PartyProbationary partyProbationary)
    {
        partyProbationary.setUpdateTime(DateUtils.getNowDate());
        return partyProbationaryMapper.updatePartyProbationary(partyProbationary);
    }

    /**
     * 批量删除预备党员申请
     * 
     * @param probationaryIds 需要删除的预备党员申请主键
     * @return 结果
     */
    @Override
    public int deletePartyProbationaryByProbationaryIds(Long[] probationaryIds)
    {
        return partyProbationaryMapper.deletePartyProbationaryByProbationaryIds(probationaryIds);
    }

    /**
     * 删除预备党员申请信息
     * 
     * @param probationaryId 预备党员申请主键
     * @return 结果
     */
    @Override
    public int deletePartyProbationaryByProbationaryId(Long probationaryId)
    {
        return partyProbationaryMapper.deletePartyProbationaryByProbationaryId(probationaryId);
    }
}
